package Method;

/**
 * ClassName:MethodDemo11
 * Package:Method
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/12-11:30
 * @Version:v1.0
 */
public class MethodDemo11 {
    public static void main(String[] args) {
        int []arr ={1,2,3,4,5};
        int Max=getMax(arr);
        System.out.println("这个数组的最大值是："+Max);
    }
    public static int getMax(int []arr){
        int max=arr[0];
        for (int i = 1; i <arr.length; i++) {
            if(arr[i]>max){
                max=arr[i];
            }
        }
        return max;
    }
}
